﻿
<%template _header%>
<%namespace YouHP.Model%>
<%namespace YouHP.Model.Group%>
<%namespace YouHP.Utility%>

 
<div class="layout2-cols2">
    <div class="col1">
		<%template _ProfileMenu%>
	</div>
<div class="col2">
    <%if IsPost%>
          <%template _msgbox%>
     <%else%>	
     
<div class="box"> 
<%template _ProfileHeader%>

<div class="content">
 
<%if UserData.Id==ProfileData.Id%>
	
	 <%if GroupListByUser.Count==0%> <h1 style="text-align:center;">您还没有自己的小圈子，马上
	 <%csharp%>TempUrl = "/User/Group/Create.aspx";<%/csharp%>
	<a href="{this.GetUrl(TempUrl)}"><font class="quicklink">创建</font></a> 或者
	
	<%csharp%>TempUrl = "/Group/Index.aspx";<%/csharp%>
	<a href="{this.GetUrl(TempUrl)}"><font class="quicklink">加入</font></a></h1>
	<%else%>
	
	
 <div class="mygrouplist">
			   <%csharp%>TempUrl = "/User/Group/Create.aspx";<%/csharp%>
        			<div style="padding:5px; text-align:right;"><a href="{this.GetUrl(TempUrl)}" ><font class="creatnewgroup">创建一个新的圈子</font></a></div>		
<div class="groupitem">
            <li>&nbsp;</li>
            <li>帖子数</li>
            <li>回复数</li>
            <li>浏览数</li>
            <li>成员数</li>
            <li>角色</li>
	<div style="clear:both;"></div>				 
</div>						         

			                <form action="" method="post" ID="form1">
			                <input type="hidden" id="formid" name="formid" value="1" />
			                <input type="hidden" id="typeid" name="typeid" value="1" />
			                <input type="hidden" id="groupid" name="groupid" value="0" />
			                <input type="hidden" id="grouprole" name="grouprole" value="0" />
			                
        							
					                <table width="725px" cellpadding="0" cellspacing="0" border="0">
						                <tbody>
        						
						                <%csharp%> foreach(GroupInfo info in GroupListByUser) { <%/csharp%>
					                  <tr class="messagetable" onmouseover="this.className='messagetableon'" onmouseout="this.className='messagetable'">
					                   <%csharp%>TempUrl = "/Group/Group.aspx?gid=" + info.Id;<%/csharp%>
					  	                <td width="80" align="center"><a href="{this.GetUrl(TempUrl)}"  target="_blank" class="user_img"><img src="{info.Logo}" width="48" height="48" id="usingavatarimg"  class ="photoimg" alt="头像"/></a><br /><span>{info.GroupName}</span></td>
        							   
					                    <td width="80">{info.TopicNum}</td>
					                    <td width="80">{info.ReplyNum}</td>
					                    <td width="80">{info.Hits}</td>
					                    <td width="80">{info.UserNum}</td>
					                    <td width="80">
                                        <%csharp%>if(info.Role==0){<%/csharp%>普通成员<%csharp%>}<%/csharp%>
                                        <%csharp%>if(info.Role==1){<%/csharp%>管理员<%csharp%>}<%/csharp%>
                                        <%csharp%>if(info.Role==2){<%/csharp%>圈主<%csharp%>}<%/csharp%>
					                    </td>
        							    
					                      <%csharp%>if(info.Role==1||info.Role==2){<%/csharp%>
					                    <td width="80">
					                    <%csharp%>TempUrl = "/User/Group/Setting.aspx?gid=" + info.Id;<%/csharp%>
					                    <a href="{this.GetUrl(TempUrl)}" class="selectall">管理</a>  
					                    </td>
					                     <%csharp%>}<%/csharp%>
					                     <%csharp%>if(info.Role==2){<%/csharp%>
					                    <td width="80"><a href="#" onclick="_$('typeid').value=1;_$('groupid').value={info.Id};_$('grouprole').value={info.Role};if(window.confirm('你是该圈子管理员，退出将删除此圈子，确定退出？')) _$('form1').submit();" class="selectall">退出</a>
					                    <%csharp%>} else {<%/csharp%>
					                    <td width="80"><a href="#" onclick="_$('typeid').value=1;_$('groupid').value={info.Id};_$('grouprole').value={info.Role};if(window.confirm('确定退出该圈子？')) _$('form1').submit();" class="selectall">退出</a>
					                    <%csharp%>}<%/csharp%>
					                    <td>&nbsp;</td>
					                </tr>
					                </tbody>
						                <%csharp%> } <%/csharp%>
					                </table>
        							 
        							
					                </form>
        						

        									
  </div>
  
    <%/if%> 
        						          
 <%else%>
   
   <%if GroupListByUser.Count==0%> <h1 style="text-align:center;">该用户还未加入任何圈子<%else%>
 
<div class="grouplist" id="mygroups">
<%csharp%>
    int n = 0;
    foreach(GroupInfo item in GroupListByUser) { 
    
<%/csharp%> 
    <%csharp%>if(n > 0 && n % 3 == 0) { <%/csharp%>        
        <div class="line"></div>
    <%csharp%> } <%/csharp%>
    <div class="groupbox">
        <%csharp%>TempUrl = "/Group/Group.aspx?gid=" + item.Id;<%/csharp%>
        <a href="{this.GetUrl(TempUrl)}" target="_blank">
            <img class="pic" src="{item.Logo}" />
        </a>
        <dl>
            <dd><strong>
            <%csharp%>TempUrl = "/Group/Group.aspx?gid=" + item.Id;<%/csharp%>
            <a href="{this.GetUrl(TempUrl)}" target="_blank">
                <%csharp%>if(item.GroupName.Length<=8){<%/csharp%>
                {item.GroupName}
                <%csharp%>}else{ string sb=item.GroupName.Substring(0,8)+"...";<%/csharp%>
                {sb}
                <%csharp%>}<%/csharp%>
            
            </a>
            </strong></dd>
            
            <dd><em>共{item.UserNum}人</em></dd>
                
            <dt>
                <a href="{this.GetUrl(TempUrl)}" target="_blank">角色:
                <%csharp%>if(item.Role==0){<%/csharp%>普通成员<%csharp%>}<%/csharp%>
                <%csharp%>if(item.Role==1){<%/csharp%>管理员<%csharp%>}<%/csharp%>
                <%csharp%>if(item.Role==2){<%/csharp%>圈主<%csharp%>}<%/csharp%>
                
                </a>
            </dt>
      
        </dl>
    </div>
<%csharp%> n++; } <%/csharp%>

</div>
   <%/if%>
       
<%/if%>
</div>
</div> 
     <%/if%> 
<div class="clearBoth"></div>
	    <div class="box">
			<div class="content">
				<div class="pages">
					{PagingString}
				</div>
			</div>
		</div>  
</div>

 

</div> 
<%template _footer%>